perm filename GRAY.MF[MF,DEK] blob
sn#770689 filedate 1984-09-29 generic text, type C, neo UTF8
COMMENT ā VALID 00004 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 % more-or-less general GRAY font generator
C00008 00003 charcode:=0
C00009 00004 r:=1
C00020 ENDMK
Cā;
% more-or-less general GRAY font generator
% if rep is defined, it should be a positive integer (pixels magnif rep times)
% if sqsize is defined, it should be 1/4 the size of a pixel representation
% if small is defined, we make only 15 characters instead of 128
% if special_pix is defined, make_pix should set pix to a pixel representation
% if pixelrep is defined, it should be a pixel representation
% sample invocations:
%% to make a gray font for your favorite local device
% **\mode=localfont; input gray
%% same, but with pixels 5x magnified
% **\mode=localfont; input gray5
% where gray5.mf contains `rep=5;small=1;input gray'
%% to make a black font (for smoke mode)
% **\mode=localfont; input black
% where black.mf contains the following:
% special_pix=1;
% def make_pix = addto pix contour unitsquare scaled 4sqsize enddef;
% input gray
mode_setup;
if not known rep: rep=1; fi;
if not known sqsize:
if pixels_per_inch<450: sqsize=1; else: sqsize=round(pixels_per_inch/300); fi;
fi;
cw=rep*4*72.27*sqsize/pixels_per_inch; % points per 4 dots
designsize:=8cw;
pxsize=rep*4*sqsize;
if known Xerox_world: % the following for Xerox Press file conventions only!
font_family "FIG";
coding_scheme "GFGRAY";
font_face_byte 78+designsize
if known special_pix: +special_pix fi;
fi
edges pix,px,PIX;
if known pixelrep: pix=pixelrep;
else:
px=pix=nulledges;
if known special_pix: make_pix
else:
addto px contour unitsquare scaled sqsize;
addto pix also px shifted (sqsize,0);
addto pix also px shifted (2sqsize,0);
addto pix also px shifted (0,sqsize);
addto pix also px shifted (0,2sqsize);
addto pix also px shifted (sqsize,3sqsize);
addto pix also px shifted (2sqsize,3sqsize);
addto pix also px shifted (3sqsize,sqsize);
addto pix also px shifted (3sqsize,2sqsize)
fi;
cull pix by (-1,1);
if rep>1:pix:=pix shifted (-1,-1);
PIX=pix;
for r=1 step 1 until rep-1: addto pix also PIX shifted (4*r*sqsize,0);
endfor
PIX:=pix;
for r=1 step 1 until rep-1: addto pix also PIX shifted (0,4*r*sqsize);
endfor
addto pix contour unitsquare
xscaled pxsize yscaled 2sqsize shifted (-sqsize,-sqsize)
withweight -1;
addto pix contour unitsquare
yscaled pxsize xscaled 2sqsize shifted (-sqsize,-sqsize)
withweight -1;
cull pix by (-9,1);
fi
fi;
def char(expr c, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, d) =
charcode:=c; currentpicture:=nulledges;
if aa=1: addto currentpicture also pix shifted(0,0); fi
if ab=1: addto currentpicture also pix shifted(0,-pxsize); fi
if ac=1: addto currentpicture also pix shifted(0,-2pxsize); fi
if ad=1: addto currentpicture also pix shifted(0,-3pxsize); fi
if ae=1: addto currentpicture also pix shifted(0,-4pxsize); fi
if af=1: addto currentpicture also pix shifted(0,-5pxsize); fi
if ag=1: addto currentpicture also pix shifted(0,-6pxsize); fi
if ah=1: addto currentpicture also pix shifted(0,-7pxsize); fi
if ai=1: addto currentpicture also pix shifted(0,-8pxsize); fi
if aj=1: addto currentpicture also pix shifted(0,-9pxsize); fi
if ak=1: addto currentpicture also pix shifted(0,-10pxsize); fi
if al=1: addto currentpicture also pix shifted(0,-11pxsize); fi
charwd:=cw*r;
chardw:=4r;
charht:=cw;
chardp:=cw*d;
% charic:=0;
extra_endchar
if displaying>0: showit; fi
shipit enddef;
fontdimen 1: 0, cw, 0, 0, cw, cw, 0,
if known rulethickness: rulethickness else: cw/2/rep fi;
charcode:=0;
currentpicture:=nulledges;
if known dotsize:
charwd:=3*72.27*dotsize/ppi;
else: charwd:=3cw/rep; dotsize=4*sqsize+1; fi
fill fullcircle scaled 2dotsize;
charht:=charwd;
chardp:=0;
charic:=0;
chardw:=1;
shipit;
r:=1;
char(001,1,0,0,0,0,0,0,0,0,0,0,0,0);
char(002,0,1,0,0,0,0,0,0,0,0,0,0,1);
char(003,1,1,0,0,0,0,0,0,0,0,0,0,1);
char(004,0,0,1,0,0,0,0,0,0,0,0,0,2);
char(005,1,0,1,0,0,0,0,0,0,0,0,0,2);
char(006,0,1,1,0,0,0,0,0,0,0,0,0,2);
char(007,1,1,1,0,0,0,0,0,0,0,0,0,2);
if known small:
r:=2; addto pix also pix shifted (pxsize,0);
char(121,1,0,0,0,0,0,0,0,0,0,0,0,0);
char(122,0,1,0,0,0,0,0,0,0,0,0,0,1);
char(123,1,1,0,0,0,0,0,0,0,0,0,0,1);
char(124,0,0,1,0,0,0,0,0,0,0,0,0,2);
char(125,1,0,1,0,0,0,0,0,0,0,0,0,2);
char(126,0,1,1,0,0,0,0,0,0,0,0,0,2);
char(127,1,1,1,0,0,0,0,0,0,0,0,0,2);
charlist 1,121;
charlist 2,122;
charlist 3,123;
charlist 4,124;
charlist 5,125;
charlist 6,126;
charlist 7,127;
else:
char(008,0,0,0,1,0,0,0,0,0,0,0,0,3);
char(009,1,0,0,1,0,0,0,0,0,0,0,0,3);
char(010,0,1,0,1,0,0,0,0,0,0,0,0,3);
char(011,1,1,0,1,0,0,0,0,0,0,0,0,3);
char(012,0,0,1,1,0,0,0,0,0,0,0,0,3);
char(013,1,0,1,1,0,0,0,0,0,0,0,0,3);
char(014,0,1,1,1,0,0,0,0,0,0,0,0,3);
char(015,1,1,1,1,0,0,0,0,0,0,0,0,3);
char(016,0,0,0,0,1,0,0,0,0,0,0,0,4);
char(017,1,0,0,0,1,0,0,0,0,0,0,0,4);
char(018,0,1,0,0,1,0,0,0,0,0,0,0,4);
char(019,1,1,0,0,1,0,0,0,0,0,0,0,4);
char(020,0,0,1,0,1,0,0,0,0,0,0,0,4);
char(021,1,0,1,0,1,0,0,0,0,0,0,0,4);
char(022,0,1,1,0,1,0,0,0,0,0,0,0,4);
char(023,1,1,1,0,1,0,0,0,0,0,0,0,4);
char(024,0,0,0,1,1,0,0,0,0,0,0,0,4);
char(025,1,0,0,1,1,0,0,0,0,0,0,0,4);
char(026,0,1,0,1,1,0,0,0,0,0,0,0,4);
char(027,1,1,0,1,1,0,0,0,0,0,0,0,4);
char(028,0,0,1,1,1,0,0,0,0,0,0,0,4);
char(029,1,0,1,1,1,0,0,0,0,0,0,0,4);
char(030,0,1,1,1,1,0,0,0,0,0,0,0,4);
char(031,1,1,1,1,1,0,0,0,0,0,0,0,4);
char(032,0,0,0,0,0,1,0,0,0,0,0,0,5);
char(033,1,0,0,0,0,1,0,0,0,0,0,0,5);
char(034,0,1,0,0,0,1,0,0,0,0,0,0,5);
char(035,1,1,0,0,0,1,0,0,0,0,0,0,5);
char(036,0,0,1,0,0,1,0,0,0,0,0,0,5);
char(037,1,0,1,0,0,1,0,0,0,0,0,0,5);
char(038,0,1,1,0,0,1,0,0,0,0,0,0,5);
char(039,1,1,1,0,0,1,0,0,0,0,0,0,5);
char(040,0,0,0,1,0,1,0,0,0,0,0,0,5);
char(041,1,0,0,1,0,1,0,0,0,0,0,0,5);
char(042,0,1,0,1,0,1,0,0,0,0,0,0,5);
char(043,1,1,0,1,0,1,0,0,0,0,0,0,5);
char(044,0,0,1,1,0,1,0,0,0,0,0,0,5);
char(045,1,0,1,1,0,1,0,0,0,0,0,0,5);
char(046,0,1,1,1,0,1,0,0,0,0,0,0,5);
char(047,1,1,1,1,0,1,0,0,0,0,0,0,5);
char(048,0,0,0,0,1,1,0,0,0,0,0,0,5);
char(049,1,0,0,0,1,1,0,0,0,0,0,0,5);
char(050,0,1,0,0,1,1,0,0,0,0,0,0,5);
char(051,1,1,0,0,1,1,0,0,0,0,0,0,5);
char(052,0,0,1,0,1,1,0,0,0,0,0,0,5);
char(053,1,0,1,0,1,1,0,0,0,0,0,0,5);
char(054,0,1,1,0,1,1,0,0,0,0,0,0,5);
char(055,1,1,1,0,1,1,0,0,0,0,0,0,5);
char(056,0,0,0,1,1,1,0,0,0,0,0,0,5);
char(057,1,0,0,1,1,1,0,0,0,0,0,0,5);
char(058,0,1,0,1,1,1,0,0,0,0,0,0,5);
char(059,1,1,0,1,1,1,0,0,0,0,0,0,5);
char(060,0,0,1,1,1,1,0,0,0,0,0,0,5);
char(061,1,0,1,1,1,1,0,0,0,0,0,0,5);
char(062,0,1,1,1,1,1,0,0,0,0,0,0,5);
char(063,1,1,1,1,1,1,0,0,0,0,0,0,5);
char(064,0,0,0,0,0,0,1,0,0,0,0,0,6);
char(065,0,0,0,0,0,1,1,0,0,0,0,0,6);
char(066,0,0,0,0,1,1,1,0,0,0,0,0,6);
char(067,0,0,0,1,1,1,1,0,0,0,0,0,6);
char(068,0,0,1,1,1,1,1,0,0,0,0,0,6);
char(069,0,1,1,1,1,1,1,0,0,0,0,0,6);
char(070,1,1,1,1,1,1,1,0,0,0,0,0,6);
char(071,0,0,0,0,0,0,0,1,0,0,0,0,7);
char(072,0,0,0,0,0,0,1,1,0,0,0,0,7);
char(073,0,0,0,0,0,1,1,1,0,0,0,0,7);
char(074,0,0,0,0,1,1,1,1,0,0,0,0,7);
char(075,0,0,0,1,1,1,1,1,0,0,0,0,7);
char(076,0,0,1,1,1,1,1,1,0,0,0,0,7);
char(077,0,1,1,1,1,1,1,1,0,0,0,0,7);
char(078,1,1,1,1,1,1,1,1,0,0,0,0,7);
char(079,0,0,0,0,0,0,0,0,1,0,0,0,8);
char(080,0,0,0,0,0,0,0,1,1,0,0,0,8);
char(081,0,0,0,0,0,0,1,1,1,0,0,0,8);
char(082,0,0,0,0,0,1,1,1,1,0,0,0,8);
char(083,0,0,0,0,1,1,1,1,1,0,0,0,8);
char(084,0,0,0,1,1,1,1,1,1,0,0,0,8);
char(085,0,0,1,1,1,1,1,1,1,0,0,0,8);
char(086,0,1,1,1,1,1,1,1,1,0,0,0,8);
char(087,1,1,1,1,1,1,1,1,1,0,0,0,8);
char(088,0,0,0,0,0,0,0,0,0,1,0,0,9);
char(089,0,0,0,0,0,0,0,0,1,1,0,0,9);
char(090,0,0,0,0,0,0,0,1,1,1,0,0,9);
char(091,0,0,0,0,0,0,1,1,1,1,0,0,9);
char(092,0,0,0,0,0,1,1,1,1,1,0,0,9);
char(093,0,0,0,0,1,1,1,1,1,1,0,0,9);
char(094,0,0,0,1,1,1,1,1,1,1,0,0,9);
char(095,0,0,1,1,1,1,1,1,1,1,0,0,9);
char(096,0,1,1,1,1,1,1,1,1,1,0,0,9);
char(097,1,1,1,1,1,1,1,1,1,1,0,0,9);
char(098,0,0,0,0,0,0,0,0,0,0,1,0,10);
char(099,0,0,0,0,0,0,0,0,0,1,1,0,10);
char(100,0,0,0,0,0,0,0,0,1,1,1,0,10);
char(101,0,0,0,0,0,0,0,1,1,1,1,0,10);
char(102,0,0,0,0,0,0,1,1,1,1,1,0,10);
char(103,0,0,0,0,0,1,1,1,1,1,1,0,10);
char(104,0,0,0,0,1,1,1,1,1,1,1,0,10);
char(105,0,0,0,1,1,1,1,1,1,1,1,0,10);
char(106,0,0,1,1,1,1,1,1,1,1,1,0,10);
char(107,0,1,1,1,1,1,1,1,1,1,1,0,10);
char(108,1,1,1,1,1,1,1,1,1,1,1,0,10);
char(109,0,0,0,0,0,0,0,0,0,0,0,1,11);
char(110,0,0,0,0,0,0,0,0,0,0,1,1,11);
char(111,0,0,0,0,0,0,0,0,0,1,1,1,11);
char(112,0,0,0,0,0,0,0,0,1,1,1,1,11);
char(113,0,0,0,0,0,0,0,1,1,1,1,1,11);
char(114,0,0,0,0,0,0,1,1,1,1,1,1,11);
char(115,0,0,0,0,0,1,1,1,1,1,1,1,11);
char(116,0,0,0,0,1,1,1,1,1,1,1,1,11);
char(117,0,0,0,1,1,1,1,1,1,1,1,1,11);
char(118,0,0,1,1,1,1,1,1,1,1,1,1,11);
char(119,0,1,1,1,1,1,1,1,1,1,1,1,11);
char(120,1,1,1,1,1,1,1,1,1,1,1,1,11);
r:=2; addto pix also pix shifted (pxsize,0);
char(121,1,1,1,1,1,1,1,1,1,1,1,1,11);
r:=4; addto pix also pix shifted (2pxsize,0);
char(122,1,1,1,1,1,1,1,1,1,1,1,1,11);
charlist 120, 121, 122;
fi
end